<!-- TODO: szc -->
<script setup>
/**
 * @libs
 */
import { ref } from 'vue'

/**
 * @data
 */
let compMess = ref({
  "left": {
    "background-image": "img_1.png"
  },
  "right": {
    "exploreMore-box-title": "豪华天堂",
    "exploreMore-box-content": "每一个细节都是为了给您最舒适的体验，我们一直在改进我们的服务质量，致力于为您提供一个更加贴心的购物环境。我们力求完美，只为确保您在每一次购物中都能感受到愉悦与满足。",
    "exploreMore-box-btn": "探索更多",
    "exploreMore-box-link": $szcyydsUrl,
    "exploreMore-box-link-isNewTab": false
  }
}
)


/**
 * 返回指定文件夹下的图片路径
 * @param {String} name 图片名称
 * @returns {String} 图片路径
 */
let getImgUrl = (name) => {
  return new URL(`/src/assets/images/mainImgs/homeImgs/part_10_imgs/${name}`, import.meta.url).href
}

/**
 * 链接跳转事件
 * @param {Boolean} isNewTab 是否新标签跳转
 * @param {String} link 链接地址
 */
let gotoNavtion = (isNewTab, link) => {
  if (isNewTab) {
    window.open(link)
  } else {
    window.location.href = link
  }
}

/**
 * 探索更多按钮点击事件
 * @param {Boolean} isNewTab 是否新标签跳转
 */
let exportMoreButtonEvent = (isNewTab) => {
  gotoNavtion(isNewTab, compMess.value['right']['exploreMore-box-link'])
}

</script>

<template>
  <div class="part-10">
    <div class="part-10-img-box">
      <img class="part-10-img-box-img" :src="getImgUrl(compMess['left']['background-image'])" alt="" srcset="">
    </div>
    <div class="part-10-exploreMore-box">
      <div class="part-10-exploreMore-box-title">{{ compMess['right']['exploreMore-box-title'] }}</div>
      <div class="part-10-exploreMore-box-content">{{ compMess['right']['exploreMore-box-content'] }}</div>
      <div class="part-10-exploreMore-box-btn" @click="exportMoreButtonEvent(compMess['right']['exploreMore-box-link-isNewTab'])">{{ compMess['right']['exploreMore-box-btn'] }}</div>
    </div>
  </div>
</template>

<style scoped>
.part-10 {
  width: 14rem;
  height: 5.6rem;
  margin: 0 auto;
  margin-top: 1rem;
  /* background-color: antiquewhite; */
  display: flex;
  flex-direction: row;
  cursor: pointer;
}

.part-10-img-box,
.part-10-img-box-img {
  width: 9rem;
  height: 5.6rem;
  min-width: 9rem;
}

.part-10-exploreMore-box {
  display: flex;
  flex-direction: column;
}

.part-10-exploreMore-box-title,
.part-10-exploreMore-box-content,
.part-10-exploreMore-box-btn {
  margin-left: 0.63rem;
}

.part-10-exploreMore-box-title {
  margin-top: 1.54rem;
  width: 3.41rem;
  height: 0.72rem;
  line-height: 0.66rem;
  font-size: 0.44rem;
  font-weight: 600;
  color: #000000;
}

.part-10-exploreMore-box-content {
  width: 4.4rem;
  height: 0.72rem;
  font-size: 0.16rem;
  font-weight: 300;
  line-height: 0.24rem;
  color: #666666;
  /* 超出两行则省略号 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  /* 限制显示两行 */
  -webkit-box-orient: vertical;
  /* 设置为垂直排列 */
  overflow: hidden;
  /* 超出内容隐藏 */
  text-overflow: ellipsis;
  /* 显示省略号 */
  line-clamp: 3;
  /* 添加标准属性 */
}

.part-10-exploreMore-box-btn {
  margin-top: 0.6rem;
  width: 1.5rem;
  height: 0.48rem;
  border-radius: 0.4rem;
  background-color: #6BC2B4;
  line-height: 0.48rem;
  text-align: center;
  font-weight: 400;
  font-size: 0.16rem;
  color: #fff;
}
</style>